'use strict';

let
    Koa = require('koa'),
    app = new Koa(),
    port = 7878,
    router = require('koa-router')(),
    statics = require('koa-static'),
    middleWare = require('./tempMiddleWare');

router.get('/', async (ctx, next) => {
    ctx.render('login.html')
    await next();
})

app.use(statics('.'));

app.use(statics(__dirname + '/view'));

app.use(middleWare);

app.use(router.routes());

app.listen(port, () => {
    console.log(`http://localhost:${port}`);
})